<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Admin Routes
|--------------------------------------------------------------------------
|
| Here is where you can register ADMIN routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

// ajax 请求
Route::group(['namespace' => 'Admin'],function (){
    Route::get('banner','IndexController@banner');
    Route::get('product','ProductController@index');
    Route::get('banner/edit','IndexController@banner_edit');
    Route::post('banner/add','IndexController@banner_add');
    Route::get('banner/delete/{id}','IndexController@banner_delete');
    Route::get('get_menu','MenuController@index');
    Route::get('get_category','MenuController@get_category');
    Route::get('home/home_hot','IndexController@home_hot');
    Route::post('user/register','LoginController@register');
    Route::post('upload/image_upload','FileController@image_upload');
    Route::post('upload/file_delete','FileController@file_delete');
    Route::post('login','LoginController@login');
    Route::post('product/add','ProductController@add');
    Route::post('user/user_info','UserController@user_info');
    Route::get('product/detail/{id}','ProductController@detail');
    Route::get('product/delete/{id}','ProductController@delete');
    Route::post('product/edit','ProductController@edit');
    Route::post('product/collection','ProductController@collection');
    Route::post('product/keyword_search','ProductController@keyword_search');
    Route::post('order/add','OrderController@add');
    Route::post('order/user_order','OrderController@order_list');
    Route::post('user/avatar_upload','UserController@avatar_upload');
    Route::post('user/edit_user','UserController@edit_user');
    Route::get('user/index','UserController@index');
    Route::get('user/admin','UserController@admin');
    Route::get('category/get_category','CategoryController@get_category');
    Route::get('order/index','OrderController@index');
    Route::post('category/add','CategoryController@add');
});

//Route::group(['middleware' => 'api','namespace' => 'Admin', 'prefix' => 'admin'],function (){
//    Route::post('/user','IndexController@index');
//});
